import Vue from 'vue'
import VueRouter from 'vue-router'
import HomeView from '../views/HomeView.vue'

Vue.use(VueRouter)

const routes = [{
		path: '/',
		name: 'home',
		component: HomeView,
		redirect: "/homepage",
		children: [
			{
				path: "homepage",
				component: () => import("../views/HomePage.vue"),
				redirect: "/homepage/minecenter",
				children:[
					{
						path: "minecenter",
						component: () => import("../views/MineCenter.vue")
					},
					{
						path: "minemore",
						component: () => import("../views/MineMore.vue")
					},
					{
						path: "mineedit",
						component: () => import("../views/MineEdit.vue")
					},
				]
			},
			{
				path: "projectmananger",
				component: () => import("../views/ProjectManager.vue"),
				redirect: "/projectmananger/projectlist",
				children: [{
						path: "projectlist",
						component: () => import("../views/ProjectList.vue")
					},
					{
						path: "ProjectListAdd",
						component: () => import("../views/ProjectListAdd.vue")
					}, {
						path: "reviseproject",
						component: () => import("../views/ReviseProject.vue")
					}
				]
			},
		 {
				path: "setup",
				component: () => import("../views/SetUp.vue"),
				redirect: "/setup/setuplist",
				children: [{
						path: "setuplist",
						component: () => import("../views/SetUpList.vue")
					},
					{
						path: "setupcontent",
						component: () => import("../views/SetupContent.vue")
					}
				]
			},
			{
				path: "staticsproject",
				component: () => import("../views/StaticsProject.vue"),
				redirect: "/staticsproject/statistics",
				children: [
					{
						path: "statistics",
						component: () => import("../views/StatisticsView.vue")
					},
					
					{
						path: "statisticsdetails",
						component: () => import("../views/StatisticsDetailsView.vue")
					}
				]
			}, {
				path: "salesdetails",
				component: () => import("../views/SalesDetails.vue")
			}, {
				path: "business",
				component: () => import("../views/BusinessView.vue"),
				redirect:"/business/businesslist",
				children:[
					{
						path:'businesslist',
						component:()=>import('../views/BusinessList.vue')
					},
					{
						path:'businessdetails',
						component:()=>import('../views/BusinessDetails.vue')
					}
				]
			}, {
				path: "orders",
				component: () => import("../views/OdersView.vue")
			}


		]
	},
	{
		path: '/login',
		name: 'login',
		component: () => import('../views/LoginView.vue')
	}
]

const router = new VueRouter({
	routes,
	linkActiveClass: "link-active"
})

export default router